<template>
    <div>
        <input v-model="title" type="text" ref="title" />
        <button ref="btn" @click="getRefs">提交</button>
    </div>
</template>

<script>

export default {
    data() {
        return {
            title: 'title'
        }
    },
    methods: {
        getRefs() {
            console.log(this.$refs.title);
            console.log(this.$refs.btn);
            // 获取父组件的dom
            console.log(this.$parent.$el)
        },
    },
}
</script>